import plugin from '../../lib/plugins/plugin.js'

//精致睡眠是8小时禁言套餐
export class sleep extends plugin {
	constructor() {
		super({
			/** 功能名称 */
			name: '精致睡眠',
			/** 功能描述 */
			dsc: '精致睡眠',
			event: 'message',
			/** 优先级，数字越小等级越高 */
			priority: 50,
			rule: [{
				/** 命令正则匹配 */
				reg: '^#*精致睡眠$',
				/** 执行方法 */
				fnc: 'sleep'
			}]
		})
	}
	async sleep(e) {
		const groups = [750081708,1019878664]
		const muteTime = 480 // 8小时

		let name = e.member?.card ? e.member.card : e.member?.nickname
		if (!groups.includes(e.group_id)) {
			return
		}
		await e.group.muteMember(e.user_id, 60 * muteTime)
		e.reply(`晚安~我的朋友~`)
		return true
	}
}